import 'package:flutter/material.dart';
import 'package:flutter01/pages/swiper.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        theme: ThemeData(
          useMaterial3: false,
          primarySwatch: Colors.blue,
        ),
        home: Scaffold(
          appBar: AppBar(
            title: const Text("Flutter App"),
          ),
          body: const MyHome(),
        ));
  }
}

class MyHome extends StatefulWidget {
  const MyHome({super.key});

  @override
  State<MyHome> createState() => _MyHomeState();
}

class _MyHomeState extends State<MyHome> {

  List<String> list = [];


  List<Widget> images = [
    const Image(image: NetworkImage("https://www.itying.com/images/flutter/1.png"), fit: BoxFit.cover,),
    const Image(image: NetworkImage("https://www.itying.com/images/flutter/2.png"), fit: BoxFit.cover,),
    const Image(image: NetworkImage("https://www.itying.com/images/flutter/3.png"), fit: BoxFit.cover,),
  ];

  @override
  void initState() {
    super.initState();
    list= const[
      "https://www.itying.com/images/flutter/1.png",
      "https://www.itying.com/images/flutter/2.png",
      "https://www.itying.com/images/flutter/3.png"
    ];
  }

  @override
  void dispose() {
    super.dispose();
  }


  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 200,
      child: Swiper(list: list)
    );
  }


}
